POV-Ray : Newsgroups : povray.general : Mathematics help needed, please. : Re: Mathematics help needed, please. Server Time
12 Aug 2024 13:21:38 EDT (-0400)
  Re: Mathematics help needed, please.  
From: Ron Parker
Date: 11 Feb 1999 13:02:57
Message: <36c31b51.0@news.povray.org>
On Thu, 11 Feb 1999 15:10:37 -0000, Andrew Cocker wrote:
>Okay, here's my problem. I'm working on an anim.
>Let's say I have two points in space. Joining these, I have a thin piece of elastic (
or
>similar stretchable material ). Threaded on this elastic are a number ( provisionally
5 )
>of spheres, spaced evenly.
>As the two points move around, how do I get the vector of each sphere as they remain
>evenly spaced along the elastic?
>I need the vector as each sphere will eventually become a blob component.

This is untested, but it should be close to what you want.

// This macro returns the center of a bead as requested
// inputs: Start    = position of start of strand (vector)
//         End      = position of end of strand (vector)
//         NumBeads = number of beads on strand (integer >= 2)
//         BeadNum  = Bead number (integer, 1 .. NumBeads)

#macro BeadPos( Start, End, NumBeads, BeadNum )
    Start+(BeadNum-1)*(End - Start)/(NumBeads-1)
#end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.